import { BaseEntity } from '../../base/entity/base';
import { Column, Entity } from 'typeorm';
import { GoodsInfoEntity } from '../../goods/entity/info';
/**
 * 购物车
 */
@Entity('order_cart')
export class OrderCartEntity extends BaseEntity {
  /**
   * 用户ID
   */
  @Column({ comment: '用户ID' })
  userId: string;

  /**
   * 商品ID
   */
  @Column({ comment: '商品ID' })
  goodsId: string;

  /**
   * 数量
   */
  @Column({ comment: '数量', default: 1 })
  count: number;

  /**
   * 商品信息快照
   */
  @Column({ type: 'json', nullable: true, comment: '商品信息快照' })
  goodsInfo: GoodsInfoEntity;
} 